<extend name="Public:base" />
<block name="body">
	<table class="table :nth-child">
		<tr>
			<td class="m_p"><span class="glyphicon glyphicon-th"></span>自定义菜单管理</td>
		</tr>
		<tr>
			<td></td>
		</tr>
	</table>
	<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 container-fluid mp_top">
		<div class="text-danger bg-danger col-xs-12 col-sm-12 col-md-12 col-lg-12 container-fluid ts info">
			注意：1级菜单最多只能开启3个，2级子菜单最多开启5个!

			只有保存主菜单后才可以添加子菜单

			生成自定义菜单,必须在已经保存的基础上进行,临时勾选启用点击生成是无效的! 第一步必须先修改保存状态！第二步点击生成!

			当您为自定义菜单填写链接地址时请填写以"http://"开头，这样可以保证用户手机浏览的兼容性更好

			撤销自定义菜单：撤销后，您的微信公众帐号上的自定义菜单将不存在；如果您想继续在微信公众帐号上使用自定义菜单，请点击“生成自定义菜单”按钮，将重新启用！
		</div>
		<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 add_m">
			<ul>
				<li>
					<span class="glyphicon glyphicon-plus"></span>
					<button href="" onclick="insert_tr()" class="btn btn-default">
						添加一级菜单
					</button>
				</li>
			</ul>
		</div>
		<div id="t" style="display:none;">
			<table class="table table-bordered table-hover" id="t_l">
				<tr id="tr_eg">
					<td>
					<input type="hidden" value="{$_SESSION['now_pub']['id']}">
					<input size="8" type="text">
					</td>
					<td>
					<input type="text" class="input-medium" size="15" data-rule-required="true" data-rule-maxlength="30" />
					<i class="icon-plus cursor_p" title="添加子菜单" rel="329780"><span class="glyphicon glyphicon-plus" onclick="insert_tr1()"></span></i></td>
					<td><i class='board'></i>
					<input type="text" class="input-medium type" placeholder="自定义关键字或选择插件" size="25" data-rule-required="true" data-rule-maxlength="200" />
					<select onclick="fz_pm(this.options[this.selectedIndex].value)">
						<option value="">可选择插件功能</option>
						<volist id="p" name="p_m_l">
							<option value="{$p[0]['plug_home']}">{$p[0]['plug_name']}</option>
						</volist>
					</select>
					<input type="hidden" value="1">
					<select>
						<option value="">请选择按钮类型</option>
						<option value="click">关键字</option>
						<option value="view">url</option>
					</select></td>
					<td>
					<button id="remove_menu" type="button" class="btn btn-xs" onclick="del_tr(this)">
						删除
					</button></td>
				</tr>
				<tr id="tr_eg">
					<td>|--------
					<input type="hidden" value="{$_SESSION['now_pub']['id']}">
					<input size="8" type="text"/>
					</td>
					<td> |--------
					<input type="text" class="input-medium" size="15" data-rule-required="true" data-rule-maxlength="30" />
					</td>
					<td> |-------- <i class='board'></i>
					<input type="text" class="input-medium type" placeholder="自定义关键字或选择插件" size="25" data-rule-required="true" data-rule-maxlength="200" />
					<select onclick="fz_pm(this.options[this.selectedIndex].value)">
						<option value="">可选择插件功能</option>
						<volist id="p" name="p_m_l">
							<option value="{$p[0]['plug_home']}">{$p[0]['plug_name']}</option>
						</volist>
					</select>
					<input type="hidden" value="2">
					<select>
						<option value="">请选择按钮类型</option>
						<option value="click">关键字</option>
						<option value="view">url</option>
					</select></td>
					<td>
					<button id="remove_menu" type="button" class="btn btn-xs" onclick="del_tr(this)">
						删除
					</button></td>
				</tr>
			</table>
		</div>
		<div class="table-responsive">
			<form method="post" id="menu_form">
				<table class="table table-bordered table-hover" id="t_a">
					<tr>
						<th>显示顺序</th>
						<th>主菜单名称</th>
						<th>触发关键词或链接地址</th>
						<th>操作</th>
					</tr>
					<volist id="menu_list" name="menu_list">
						<tr id="tr{$menu_list['id']}">
							<td>
							<if condition="$menu_list['grade'] eq 2">
								|--------
							</if>
							<input type="hidden" name="mp_id{$menu_list['id']}" value="{$_SESSION['now_pub']['id']}">
							<input type="text" size="8" name="path{$menu_list['id']}" value="{$menu_list['path']}">
							</td>
							<td>
							<if condition="$menu_list['grade'] eq 2">
								|--------
							</if>
							<input type="text" class="input-medium" size="15"  name="name{$menu_list['id']}" value="{$menu_list['name']}" data-rule-required="true" data-rule-maxlength="30" />
							<if condition="$menu_list['grade'] neq 2">
								<i class="icon-plus cursor_p" title="添加子菜单" rel="329780"><span class="glyphicon glyphicon-plus" onclick="insert_tr1()"></span></i>
							</if></td>
							<td>
							<if condition="$menu_list['grade'] eq 2">
								|--------
							</if><i class='board'></i>
							<input type="text" class="input-medium type" value="{$menu_list['menu']}" placeholder="自定义关键字或选择插件" size="25" id="url{$menu_list['id']}"  name="menu{$menu_list['id']}" data-rule-required="true" data-rule-maxlength="200" />
							<select onclick="fz_pm(this.options[this.selectedIndex].value)">
								<option value="">可选择插件功能</option>
								<volist id="p" name="p_m_l">
									<option value="{$p[0]['plug_home']}">{$p[0]['plug_name']}</option>
								</volist>
							</select>
							<input type="hidden" name="grade{$menu_list['id']}" value="{$menu_list['grade']}">
							<select name="type{$menu_list['id']}">
								<option value="">请选择按钮类型</option>
								<option value="click">关键字</option>
								<option value="view">url</option>
							</select></td>
							<td>
							<button id="remove_menu" type="button" class="btn btn-xs" onclick="del_tr(this)">
								删除
							</button></td>
						</tr>
					</volist>
				</table>
		</div>
	</div>
	<div>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" id="bsubmit" onclick="update_ac('__MODULE__/MemberPublic/create_menu')" class="btn btn-primary" value="生成自定义菜单"/>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<button id="remove_menu" type="button" class="btn">
			撤销自定义菜单
		</button>

	</div>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>

</block>